const mongoose = require('mongoose')
const mongoosePaginate = require('mongoose-paginate-v2')
const Schema = mongoose.Schema
// 防止店名重复 判断用 _id
let ClientSchema = new Schema({
  opCode: String,
  opName: String,
  loginUser: String,
  password: String,
  area: String,
  brands: [ String ],
  stores: [
    {
      store: String,
      brands: [ String ],
      address: String
    }
  ]
})

ClientSchema.plugin(mongoosePaginate)

module.exports = mongoose.model('Client', ClientSchema)